package board;

import interceptor.IbatisAware;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Preparable;

import dto.pensionBoard;

public class viewAction extends ActionSupport implements Preparable, ModelDriven, IbatisAware{
	
	private SqlMapClient sqlMapper;
	public pensionBoard paramClass;
	
	public String execute() throws Exception {
		
		return SUCCESS;
	}
	
	public String pBoardInfo() throws Exception{
		System.out.println("article_num :" + paramClass.getPb_article_num());
		paramClass = (pensionBoard)sqlMapper.queryForObject("article_num", paramClass.getPb_article_num());
		System.out.println(paramClass);
		System.out.println(paramClass.getPb_content());
		
		System.out.println("paramClass.getPb_file1_original() : "+ paramClass.getPb_file1_original());
		System.out.println("paramClass.getPb_file1_saved() : "+ paramClass.getPb_file1_saved());
		
		
		return SUCCESS;
	}

	public void setParamClass(pensionBoard paramClass){
		this.paramClass = paramClass;
	}
	public pensionBoard paramClass(){
		return paramClass;
	}
	@Override
	public void setIbatis(SqlMapClient sqlMapper) {
		// TODO Auto-generated method stub
		this.sqlMapper = sqlMapper;
		
	}

	@Override
	public Object getModel() {
		// TODO Auto-generated method stub
		return paramClass;
	}

	@Override
	public void prepare() throws Exception {
		// TODO Auto-generated method stub
		this.paramClass = new pensionBoard();
	}

}
